import axios from './axios'

export const queryByTaskId = (taskId) => {
    return axios.request({
        url: '/work/queryByTaskId?taskId=' + taskId,
        method: 'post'
    })
}

export const queryById = (id) => {
    return axios.request({
        url: '/work/queryById?id=' + id,
        method: 'post'
    })
}

export const addWork = (work) => {
    return axios.request({
        url: '/work/add',
        method: 'post',
        data: work

    })
}

export const deleteById = (id) => {
    return axios.request({
        url: '/work/deleteById?id=' + id,
        method: 'post'
    })
}

export const edit = (work) => {
    return axios.request({
        url: '/work/edit',
        method: 'post',
        data: work
    })
}

export const mark = (workId, score) => {
    return axios.request({
        url: '/work/mark?workId=' + workId + '&score=' + score,
        method: 'post'
    })
}

export const queryByStudentIdAndTaskId = (studentId, taskId) => {
    return axios.request({
        url: '/work/queryByStudentIdAndTaskId?studentId=' + studentId + '&taskId=' + taskId,
        method: 'post'
    })
}